/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.webdeve;

import dao.*;
import entities.Product;
import entities.*; 
import java.sql.Date; 
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
 *
 * @author theworldiwant
 */
public class testing {
    public static void main(String[] args){
         
        DAOFactory myDAOFactory = DAOFactory.getInstance(DAOFactory.MYSQL);
        /*
        UserDAO us = myDAOFactory.createUserDAO();
        User u = new User();
        u.setUsername("test");
        u.setPassword("you");
        u.setGender('M');
        u.setUserTypeId(1);
        us.addUser(u);
       */
        ProductCatDAO c1 = myDAOFactory.createProdCatDAO();
        LinkedList<ProductCategories> list=c1.arrangeAlp();
        for(ProductCategories pc: list){
            System.out.println(pc.getName());
        }
        /*
        ProductCatDAO c1 = myDAOFactory.createProdCatDAO();
        ProductDAO p1 = myDAOFactory.createProductDAO();
        Product p = new Product(); 
        p.setName("Switched");
           
        p.setDescription("When Wendy Everly was six-years-old, her mother was convinced she was a monster and tried to kill her. It isn't until eleven years later that Wendy finds out her mother might've been telling the truth. With the help of Finn Holmes, Wendy finds herself in a world she never knew existed - and it's one she's not sure if she wants to be a part of.");
        p.setPrice(394.488);
        p.setImagePic("http://photo.goodreads.com/books/1288828865l/8564935.jpg");
        p.setAuthor("Amanda Hocking");
        p.setDatePublished(new Date(2010-1900, 7-1, 12));
        Category c ;
        ArrayList<String> genre = new ArrayList<String>();
        genre.add("Young Adult");
        genre.add("Fantasy");
        genre.add("Paranormal");
        LinkedList<Tags> tags = new LinkedList<Tags>();
        Tags t= new Tags();
        t.setTags("Trylle");
        tags.add(t);
        
        LinkedList<Category> list = new LinkedList<Category>();
        
        for(String str: genre){
            c=new Category();
            c.setProductId(p1.getCurId()+1);
            c.setCategoryId(c1.getCatIdGenre(str));
            list.add(c);
        }
         p.setTags(tags);
         p.setCs(list);
         p1.addProduct(p);
           
           */
 }
}
